<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>展示所有用户</title>
<style type="text/css">
	div{
		width: 80%;
	}
	.table{
		border-collapse: collapse;
		border: 1px solid #ccc;
		text-align: center;
		width: 80%;
	}
	.table td{
		border: 1px solid #ccc;
	}
</style>
</head>
<body>
<center>
	<div><a href="${pageContext.request.contextPath }/cargo/toAddCargo.do">下单</a></div>
	<div>
	<form action="${pageContext.request.contextPath }/user/addUser.do" method="post" enctype="multipart/form-data">
		<table>
			<caption>添加用户</caption>
			<tr>
				<td>用户名</td>
				<td><input type="text" name="userName"></td>
				<td>手机号</td>
				<td><input type="text" name="userPhone"></td>
				<td>密码</td>
				<td><input type="password" name="userPassword"></td>
				<td>上传驾驶证图片</td>
				<td><input type="file" name="file" /></td>
				<td><input type="submit" value="添加"></td>
			</tr>
		</table>
	</form>
		<table class="table" align="center">
			<tr>
				<td>序列</td>
				<td>用户名</td>
				<td>手机号</td>
				<td>密码</td>
				<td>操作</td>
			</tr>
		<c:forEach var="ul" items="${userlist }" varStatus="vs">
			<tr>
				<td>${vs.count }</td>
				<td>${ul.userName }</td>
				<td>${ul.userPhone }</td>
				<td>${ul.userPassword }</td>
				<td>
					<c:if test="${ul.usual==true }" >
						<a href="${pageContext.request.contextPath }/user/deleteUser.do?isusual=1&userId=${ul.userId }">禁用</a>
					</c:if>
					<c:if test="${ul.usual==false }" >
						<a href="${pageContext.request.contextPath }/user/deleteUser.do?isusual=0&userId=${ul.userId }">启用</a>
					</c:if>
						&nbsp;&nbsp;&nbsp;<a href="${pageContext.request.contextPath }/user/deleteUser.do?ismove=0&userId=${ul.userId }">删除</a>
						&nbsp;&nbsp;&nbsp;<a href="${pageContext.request.contextPath }/user/toUpdate.do?userId=${ul.userId }">更新</a>
				</td>
			</tr>
		</c:forEach>
		</table>
	</div>
</center>
</body>
</html>